
<?
	   layout("/inc/win_layout.html",{title:sysTitle}){
    ?>

<div class="col-lg-12">
	<div class="panel panel" style="padding-top:6%;">
		<div class="panel-body pan" style="height: 500px">
			<div class="form-body pal">
				<div>
					<label for="inputUsername" class="col-md-3 control-label">知识发布名称<span
						class='require'>*</span> </label>
					<div class="col-md-9">
						<div class="input-icon">
							<input id="name" type="text" class="form-control" />
						</div>
					</div>
				</div>
				<div>
					<label for="inputUsername" class="col-md-3 control-label">知识发布描述
						<span class='require'>*</span> </label>
					<div class="col-md-9">
						<div class="input-icon">
							<textarea rows="6" cols="38"  style="width: 100%;" id="description"></textarea>
							<!-- <input id="description" type="text" class="form-control" /> -->
						</div>
					</div>
				</div>
				<div>
					<label for="inputUsername" class="col-md-3 control-label">知识库名称<span
						class='require'>*</span> </label>
					<div class="col-md-9">
						<div class="input-group input-group-sm mbs">
							<input id="parentclassname" type="text" placeholder="" class="form-control" disabled="true" /> 
							<span class="input-group-btn">
							<button onclick="saveclassZTree()" type="button" data-toggle="dropdown" class="btn btn-success dropdown-toggle">选择...</button>
							</span> 
							<input id="parentClassid" type="hidden" value="00" class="form-control" />
						</div>
					</div>
				</div>
				<div>
					<label for="inputUsername" class="col-md-3 control-label">是否增量更新
					</label>
					<div class="col-md-9">
						<div class="input-icon">
							<select id="isIncrementIndex" class="form-control">
								<option value="1">是</option>
								<option value="0">否</option>
							</select>
						</div>
					</div>
				</div>
				<div>
					<label for="inputUsername" class="col-md-3 control-label">是否发布全文
					</label>
					<div class="col-md-9">
						<div class="input-icon">
							<select id="isFullText" class="form-control">
								<option value="0">否</option>
								<option value="1">是</option>
							</select>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<?}?>
<script type="text/javascript">
	function saveclassZTree() {
		parent.layer.open({
			type : 2,
			area : [ '500px', '500px' ],
			fix : false, //不固定
			scrollbar : false,
			shadeClose : true,
		//	move : false,
			title : "知识库",
			skin : 'layui-layer-rim', //加上边框
			btn : [ '保存 ', '关闭' ],
			content : [ "knowledge-edit-data-dic-ztree.html?winName="+window.name, 'no' ],
			yes : function(index, layer) {
				var iframeWin = parent.window[layer.find('iframe')[0]['name']];
				iframeWin.save();
			},
			cancel : function(index) {
			}
		});
	};
	
function save() {  
//alert($("#isIncrementIndex").val()) ;
    $.ajax({  
	       type : "post",  
	       url : "knowledge-edit-data-submit-ajax.html",  
	       data : {
	       "name":$("#name").val(),
	       "description":$("#description").val(),
	       "classesId":$("#parentClassid").val(),
	       "isIncrementIndex":$("#isIncrementIndex").val(),
	       "isFullText":$("#isFullText").val()
	       },
	       dataType : "json", 
	       async:false,  
	       success : function(data) { 
	   var index = parent.layer.getFrameIndex(window.name);
	   window.parent.tabulate(); 
	   parent.layer.msg('添加成功');
	   parent.layer.close(index); 
	       },
	    error : function(data) {
	          alert("增加失败");
		}
	});
} 
</script>
